#!/bin/python
from subprocess import *
import os
class Compiler():
    
    def __init__(self,compiler="GCC"):
        self.compiler = compiler            
            
    def compile_source(self,source):
        outFileName = source[:-2]+".out"
        compileProcess = Popen(["gcc",source,"-o",outFileName],stdout = PIPE, stderr = PIPE)
        output = compileProcess.communicate()
        if output[1]=='':
            return True,output[1]
        else:
            return False,output[1]
if __name__=="__main__":
    c = Compiler()
    c.compile_source("simplebin2.c")
        
        
        
        
